//////////////////////////////////////
//                                  //
//           petable.js             // 
//                                  //
//////////////////////////////////////

function recordStrike()
{
	eval('parent.Toolbar.responseArray' + parent.Toolbar.section + 't' + parent.Toolbar.topic + '[' + (QUESTION_NUMBER-1) + '] = false;');
}

function recordLetter()
{
	eval('parent.Toolbar.responseArray' + parent.Toolbar.section + 't' + parent.Toolbar.topic + '[' + (QUESTION_NUMBER-1) + '] = true;');
}

var answers = new Array();
var questionsLength = eval('parent.Toolbar.answerArray' + parent.Toolbar.section + 't' + parent.Toolbar.topic  + '[' + (QUESTION_NUMBER-1) + '].length');

//alert("questionsLength = " + questionsLength);

for (var i=0;i<questionsLength ;i++)
{
	answers[i] = eval('parent.Toolbar.answerArray' + parent.Toolbar.section + 't' + parent.Toolbar.topic + '[' + (QUESTION_NUMBER-1) + '][' + i + ']');
}

var question = eval('parent.Toolbar.questionArray' + parent.Toolbar.section + 't' + parent.Toolbar.topic + '[' + (QUESTION_NUMBER-1) + ']');

if (parent.Toolbar.inSubtopic())
{
	var subTopic = parseInt(parent.Toolbar.topic);
	var subChar = parent.Toolbar.topic.charAt(parent.Toolbar.topic.length-1);
	var subNumber = parent.Toolbar.getSubtopic(subChar);

	window.document.write("<div id='Title22' style='position:absolute; width:693px; height:31px; z-index:1; left: 10px; top: 10px' class='SubTitle'>" + parent.Toolbar.subtopicPageTitles[parent.Toolbar.section-1][subTopic-1][subNumber][parent.Toolbar.page-1] + "</div><br>");
}
else
{
	//alert("<div id='Title22' style='position:absolute; width:693px; height:31px; z-index:1; left: 10px; top: 10px' class='Title'>" + parent.Toolbar.pageTitles[parent.Toolbar.section-1][parent.Toolbar.topic-1][parent.Toolbar.page-1] + "</div>");	
	//window.document.write("<div id='Title22' style='position:absolute; width:693px; height:31px; z-index:1; left: 10px; top: 10px' class='Title'>" + parent.Toolbar.pageTitles[parent.Toolbar.section-1][parent.Toolbar.topic-1][parent.Toolbar.page-1] + "</div>");	
}

window.document.write("<div id=\"Correct\" style=\"position:absolute; width:600px; height:90px; z-index:14; left: 25px; top: 340px; visibility: hidden\" class=\"Text\">" + eval('parent.Toolbar.correctFeedback' + parent.Toolbar.section + 't' + parent.Toolbar.topic + '[' + (QUESTION_NUMBER-1) + ']') + "</div>");
window.document.write("<div id=\"Incorrect\" style=\"position:absolute; width:600px; height:90px; z-index:15; left: 25px; top: 340px; visibility: hidden\" class=\"Text\">" + eval('parent.Toolbar.incorrectFeedback' + parent.Toolbar.section + 't' + parent.Toolbar.topic + '[' + (QUESTION_NUMBER-1) + ']') + "</div>"); 


window.document.write("<div id=\"Layer11232\" style=\"position:absolute; width:450px; height:189px; z-index:1; left:10px; top:100px\">");
window.document.write("  <table width=\"500\" border=\"0\" cellspacing=\"5\" cellpadding=\"5\">");
window.document.write("    <tr align='left'><th colspan=2><span class='BoldText'>" + question + "</span><br>");
window.document.write("    </th></tr>");

for (var i=0;i<questionsLength;i++)
{
	var buttonName;
	switch (i)
	{
		case 0:buttonName = "a";break;
		case 1:buttonName = "b";break;
		case 2:buttonName = "c";break;
		case 3:buttonName = "d";break;
		case 4:buttonName = "e";break;
		case 5:buttonName = "f";break;
	}
	
	window.document.write("    <tr>");
	window.document.write("      <td width=\"28\"><a href = \"#\" onFocus=\"if(navigator.appName == 'Microsoft Internet Explorer')this.blur();\" onClick = \"handleClick(PEButton" + (i+1) + ")\" onMouseOver = \"handleMouseOver(PEButton" + (i+1) + ")\" onMouseDown = \"handleMouseDown(PEButton" + (i+1) + ")\" onMouseUp = \"handleMouseUp(PEButton" + (i+1) + ")\" onMouseOut = \"handleMouseOut(PEButton" + (i+1) + ")\"><img src=\"../shared/" + buttonName + "1.jpg\"   border = \"0\" name = \"PEButton" + (i+1) + "\" onLoad = \"this.index = " + i + ";\"></a></td>");
	window.document.write("      <td width=\"422\"><span class='Text'>" + answers[i] + "</span></td>");
	window.document.write("    </tr>");
}
window.document.write("  </table>");
window.document.write("</div>");


